package com.siemens.exercise;

import java.util.ArrayList;
//sub
public class SubtractExecute implements Command {

	@Override
	public int calc(String s) throws NegtiveNumException {
		ArrayList<Integer> num = StringFilter.getNumbers(s);
	
		int result = num.get(0);
		for (int i = 1; i < num.size(); i++){
			result -= num.get(i);
		}	
		return result;
	}
}
